<?php

	require_once APPPATH . 'controllers/base_controllers/base_controller.php';
	
	class walker extends Base_controller
	{
		public function __construct()
		{
			parent::__construct();
		}
		
		
		public function directory()
		{
			$this->load->model('proxies/Walk_proxy');
			
			$data['title'] = 'Find A Participant To Sponsor';
			$data['view'] = 'walk/walker/walker_directory_view';
			$data['walkers'] = $this->Walk_proxy->getWalkerDirectory();
			
			$this->load->view( 'templates/registration/registration_template', $data );
		}
		
		
		public function home( $urlKey )
		{
			$this->load->model('values/cwr_registrant_member_homepage_value');
			$this->load->model('proxies/Cwr_registrant_member_proxy');
			$this->load->model('proxies/Metric_proxy');
			$this->load->model('proxies/Walk_proxy');
			
			$cwr_registrant_home_value = Cwr_registrant_member_homepage_value::cast($this->Cwr_registrant_member_proxy->getRegistrantMemberHomepageFromUrl( $urlKey ));
			
			$data['title'] = 'Walk/Run for CORD '.$this->Walk_proxy->getCurrentYear();
			$data['view'] = 'walk/walker/walker_home_view';
			$data['cwr_registrant_home_value'] = $cwr_registrant_home_value;
			$data['urlKey'] = $urlKey;
			$data['goal'] = $this->Metric_proxy->getPersonGoal( $cwr_registrant_home_value->getPersonId() );
			$data['raised'] = $this->Metric_proxy->getPersonTotalRaised(  $cwr_registrant_home_value->getPersonId()  );
			
			$this->load->view( 'templates/registration/registration_template', $data );
		}
	}

?>